package com.teamin.service;

import com.alibaba.fastjson.JSONObject;
import com.teamin.service.impl.wx.TemplateValueColor;
import com.teamin.service.impl.wx.WeChatMPTokenManager;
import com.teamin.web.Evn;
import com.teamin.web.https.HttpRequest;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by qfu on 2017/9/28.
 * ☀老鱼
 */
public class ma {
    public static void main(String args[]) {

        System.out.println(System.currentTimeMillis());

        System.out.println(new Date(1512443590240L));
    }


    private static void v1() {
        Pattern patternAt = Pattern.compile("\\`\\^\\-\\>@[\\w\\W]{1,15}\\([0-9]{1,10}\\)\\<\\-\\$\\`");
        Pattern patterNumber = Pattern.compile("@[\\w\\W]{1,15}\\(");
        Matcher matcher = patternAt.matcher("`^->@☀老鱼扶强a(112)<-$`asdfasdfds`^->@2112<-$`");
        StringBuffer sb = new StringBuffer();
        while (matcher.find()) {
            String g = matcher.group();;
            String sIndex = g.substring(g.indexOf("@"), g.lastIndexOf("("));;
            Matcher matterNumber = patterNumber.matcher(g);
            matcher.appendReplacement(sb, sIndex);//当前替之前的字符放入到StringBuffer
        }
        matcher.appendTail(sb);	//将当前替换之后的字符放入到StringBuffer中

        System.out.println(sb.toString());
    }

    private static void v2() {
        List<Long> uList = new ArrayList<>() ;
        Pattern pattern = Pattern.compile("\\`\\^\\-\\>@[\\w\\W]{1,15}\\([0-9]{1,10}\\)\\<\\-\\$\\`");
        Pattern patterNumber = Pattern.compile("@[\\w\\W]{1,15}\\([0-9]+\\)");
        Matcher matcher = pattern.matcher("`^->@☀老鱼扶强a(112)<-$`asdfasdfds`^->@2112<-$`");
        while (matcher.find()) {
            String g = matcher.group();
            System.out.println(g);
            uList.add(Long.parseLong(g.substring(g.lastIndexOf("(")+1,g.lastIndexOf(")")))) ;
        }

        for(int i = 0 ; i < uList.size() ; i ++ ) {
            System.out.println(uList.get(i));
        }
    }



}
